package com.hdoit.kylin.web.user.modelconfig;

import com.tennetcn.common.enums.regular.RegularExpressions;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author admin
 * @email
 * @createtime 2017年07月25日 16:10:11
 * @comment
 */
public class ContactConfig extends ModelMetadataAttributeConfiguration {
	public ContactConfig() {
		this.setProperty("contactName")
			.hasAttribute(new DisplayNameAttribute("联系人姓名"))
			.hasAttribute(new RequiredAttribute("联系人姓名为必填项"));
		this.setProperty("work")
			.hasAttribute(new DisplayNameAttribute("工作"));
		this.setProperty("phone")
			.hasAttribute(new DisplayNameAttribute("电话"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.mobile));
		this.setProperty("email")
			.hasAttribute(new DisplayNameAttribute("邮箱"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.email));
		this.setProperty("moreInfo")
			.hasAttribute(new DisplayNameAttribute("更多信息"));
		this.setProperty("address")
			.hasAttribute(new DisplayNameAttribute("地址"));
	}
}